<template>
    <view class="page">
		<view class="popup-cont">
			<view class="g-order-deital">
				<view class="d-title">订单明细:</view>
				<view class="item" v-if="item.pay_way_text" v-for="(item,index) in orderData " :key="index">
					<view class="order-title">订单号：{{item.order_no}}</view>
					<view class="order-deital">
						<view class="fex"><text class="name">购买金额：</text><text class="text price">¥{{item.total_price}}</text></view>
						<view class="fex" v-if="item.pay_order_no"><text class="name">支付订单：</text><text class="text">{{item.pay_order_no}}</text></view>
						<view class="fex"><text class="name">购买时间：</text><text class="text">{{item.pay_time_text}}</text></view>
						<view class="fex"><text class="name">支付方式：</text><text class="text">{{item.pay_way_text}}</text></view>
						<view class="fex"><text class="name">支付状态：</text><text class="text">{{item.pay_status_text}}</text></view>
						<view class="fex"><text class="name">购买份数：</text><text class="text">{{item.buy_num}}份</text></view>
						<view class="fex" v-if="item.new_money"><text class="name">可用新粮仓：</text><text class="text">{{item.new_money}}</text></view>
						<view class="fex" v-if="item.old_money"><text class="name">可用旧粮仓：</text><text class="text">{{item.old_money}}</text></view>
					</view>
				</view>
			</view>
			<view class="g-handle-deital">
				<view class="d-title">操作明细:</view>
				<view class="g-container g-nav-title">
					<view>序号</view>
					<view>购买折扣</view>
					<view>价格</view>
					<view class="handle">操作</view>
				</view>
				<view class="g-popup-content">
					<view class="g-container g-line" v-for="(item,index) in lotteryData" :key="index">
						<view>{{index+1}}</view>
						<view :style="{color: '#d61311'}">{{item.buy_discount/10 == 0?'免费':item.buy_discount/10+'折'}}</view>
						<view>￥{{item.shop_price}}</view>
						<view class="handle">{{item.handle_result_text}}</view>
					</view>
				</view>
			</view>
			<view class="g-buy-detail">
				<view class="d-title">合计:</view>
				<view class="g-detail-left b-right">
					<view>
						<text>参团</text>
						<text>¥{{totalData.total_money}}</text>
					</view>
					<view>
						<text>发货</text>
						<text>¥{{totalData.total_fahuo}}</text>
					</view>
				</view>
				<view class="g-detail-left">
					<view v-if="totalData.total_daishou != 0">
						<text>代售</text>
						<text>¥{{totalData.total_daishou}}</text>
					</view>
					<view>
						<text>退货</text>
						<text>¥{{totalData.total_tuihuo}}</text>
					</view>
				</view>
			</view>
			<view class="g-frozen-info">
				<view class="d-title">资金明细:</view>
				<view class="item" v-for="(item,index) in frozenData " :key="index">
					<view class="info"><view><text class="num">米粮:{{item.frozen_money}}</text><text class="state">({{item.status_text}})</text></view><view class="time">{{item.start_time_text}}</view></view>
					<view class="content"><text>{{item.remark}}</text></view>
				</view>
			</view>
			<view class="g-frozen-info" v-if="weiData.length != 0">
				<view class="d-title">代售明细:</view>
				<view class="item">
					<view class="info"><view><text class="num">米粮:{{weiData.money}}</text><text class="state">({{weiData.is_accept}})</text></view><view class="time">{{weiData.create_time}}</view></view>
					<view class="content"><text>{{weiData.remark}}</text></view>
				</view>
			</view>
			<view class="g-frozen-info" v-if="fahuo.length != 0">
				<view class="d-title">发货状态:<text class="state">{{fahuo.is_accept}}</text></view>
			</view>
			
		</view>
		<view class="m-full-loading" v-if="showloading">
			<image src="../../static/images/loading.gif" mode="widthFix"></image>
		</view>
    </view>
</template>
<script>
    import henglang from '@/common/common.js';
    export default {
        data() {
            return {
			    totalData:[], 
				lotteryData: [], 
				orderData: [],
				frozenData: [],
			    showloading: false,
				weiData:[],
				fahuo:[]
            };  
        },
        methods: {
           
        },
        onLoad({
			team_id
		}) {
			let that = this
			that.showloading = true;
			henglang.get('order/getLotteryHandleList',{team_id: team_id},true,function(res){
				that.showloading = false;
				that.totalData = res.data.data;
				that.lotteryData = res.data.data.lottery;
				that.orderData = res.data.data.order;
				that.frozenData = res.data.data.frozen;
				that.weiData = res.data.data.weituo;
				that.fahuo = res.data.data.fahuo
			});
        }
    }
</script>

<style>
	.page{
		background: #ffffff;
	}
	.popup-cont{
		font-size: 30upx;
		width: 656upx;
		margin: 0 auto;
	}
	.popup-cont .d-title{
		width: 100%;
		color: #d71511;
		font-weight: bold;
		position: relative;
		padding: 10upx 0;
		padding-left: 30upx;
	}
	.popup-cont .d-title:after{
		content: '';
		position: absolute;
		left: 0upx;
		top: 50%;
		margin-top: -15upx;
		width: 6upx;
		height: 30upx;
		background: #d71511;
	}
	.g-nav-title{
		line-height: 50upx;
		width: 100%;
	}
	.g-container {
	    display: flex;
		text-align: center;
		align-items: center;
	}
	.g-container > view {
		width: 23%;
	}
	.g-container .handle{
		width: 31%;
		color: #707070;
	}
	.popup-cont .u-arrow {
	    display: inline-block;
	    border: 10upx solid;
	    border-color: #707070 transparent transparent transparent;
	    transform: translate(54%,26%);
	}
	.popup-cont .g-line {
		border-bottom: 1px solid #f5f5f5;
	}
	.popup-cont .g-popup-content {
		width: 100%;
		margin-bottom: 20upx;
	}
	.popup-cont .g-popup-content .g-container{
		height: 100upx;
	}
	.popup-cont .g-buy-detail {
		margin-bottom: 20upx;
	}
	.popup-cont .g-detail-left {
		display: inline-block;
		font-size: 28upx;
		width: 230upx;
		position: relative;
	}
	.popup-cont .g-detail-left.b-right{
		padding-right: 40upx;
		padding-left: 20upx;
		margin: 0 40upx;
	}
	.popup-cont .g-detail-left.b-right:after{
		content: '';
		position: absolute;
		top: 50%;
		right: 0;
		background: #DCDCDC;
		width: 1px;
		height: 84upx;
		margin-top: -42upx;
	}
	.popup-cont .g-detail-left view{
		width: 100%;
		display: flex;
		justify-content: space-between;
		padding: 10upx 0;
	}
	.g-order-deital{
		background: #ffffff;
		width: 100%;
		padding: 20upx 0;
	}
	.g-order-deital .item{
		background: #ffffff;
		border-radius: 3px;
		box-shadow: 0 0 5px rgba(0, 0, 0, .2);
		padding: 20upx;
		margin-top: 20upx;
	}
	.g-order-deital .order-title{
		color: #333333;
		padding: 10upx 0;
		padding-left: 30upx;
	}
	.g-order-deital .price{
		color: #D71511;
		font-size: 36upx;
		font-weight: bold;
	}
	.g-order-deital .fex{
		padding: 5upx 0;
	}
	.g-order-deital .order-deital{
		padding-left: 30upx;
	}
	.g-frozen-info{
		padding-bottom: 20upx;
	}
	.g-frozen-info .info{
		display: flex;
		justify-content: space-between;
		margin-top: 10upx;
		padding-left: 30upx;
	}
	.g-frozen-info .info .num{
		font-weight: bold;
		color: #D71511;
		margin-right: 10upx;
	}
	.g-frozen-info .info .time{
		color: #828080;
	}
	.g-frozen-info .content{
		color: #828080;
		margin-left: 30upx;
		border-bottom: 1px dashed #cccccc;
		padding-bottom: 10upx;
	}
	.g-frozen-info .item{
		padding: 10upx 0;
	}
	.g-frozen-info .state{
		color: #000000;
	}
</style>
